YARN-11228. [Federation] Add getAppAttempts, getAppAttempt REST APIs for Router.#4695
YARN-11228. [Federation] Add getAppAttempts, getAppAttempt REST APIs for Router.#4695goiri merged 7 commits intoapache:trunkfrom
Conversation
|
|
||
| try { | ||
| ApplicationId applicationId = ApplicationId.fromString(appId); | ||
| SubClusterInfo subClusterInfo = getHomeSubClusterInfoByAppId(applicationId); |
There was a problem hiding this comment.
I should've proposed this before but we keep doing this string to ApplicationId.
We could just have this getHomeSubClusterInfoByAppId() to take a string and do the transformation there.
There was a problem hiding this comment.
Thanks for your suggestion, I will modify the code.
| } | ||
|
|
||
| @Override | ||
| public org.apache.hadoop.yarn.server.webapp.dao.AppAttemptInfo getAppAttempt(HttpServletRequest req, HttpServletResponse res, |
There was a problem hiding this comment.
We need to specify the whole type? Where is the conflict?
There was a problem hiding this comment.
I found 2 conflicts
org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.AppAttemptInfo
org.apache.hadoop.yarn.server.webapp.dao.AppAttemptInfo
The way to resolve the conflict, I will create the method in other classes(TestRouterWebServiceUtil#generateAppAttemptInfo)
| } catch (IllegalArgumentException e) { | ||
| String msg = String.format("Unable to get the AppAttempt appId: %s, appAttemptId: %s.", | ||
| appId, appAttemptId); | ||
| RouterServerUtil.logAndThrowRunTimeException(msg, e); |
There was a problem hiding this comment.
Could we create a logAndThrowRunTimeException that already does the format?
There was a problem hiding this comment.
This is a good idea, I will modify the code.
|
|
||
| AppAttemptsInfo appAttemptsInfo = interceptor.getAppAttempts(null, appId.toString()); | ||
| Assert.assertNotNull(appAttemptsInfo); | ||
| Assert.assertTrue(!appAttemptsInfo.getAttempts().isEmpty()); |
There was a problem hiding this comment.
Can we check before the submission too?
It would be nice to check something more specific than not empty.
There was a problem hiding this comment.
Your suggestion is right, this part needs to be refactored, I will fix it.
| ApplicationSubmissionContextInfo context = new ApplicationSubmissionContextInfo(); | ||
| context.setApplicationId(appId.toString()); | ||
| Assert.assertNotNull(interceptor.submitApplication(context, null)); | ||
| ApplicationAttemptId appAttemptIdExcept = ApplicationAttemptId.newInstance(appId, 1); |
There was a problem hiding this comment.
Probably create the appId and attemptId one after the other.
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
| @Unstable | ||
| public static void logAndThrowException(String errMsg, Throwable t) | ||
| throws YarnException { | ||
| throws YarnException { |
There was a problem hiding this comment.
The old indentation was correct, no?
There was a problem hiding this comment.
Thanks for your help reviewing the code, I will fix it.
| */ | ||
| @Public | ||
| @Unstable | ||
| public static void logAndThrowRunTimeException(String errMsgFormat, Throwable t, Object... args) |
There was a problem hiding this comment.
The order of the parameters is tricky.
I wonder if it would be cleaner to have the Throwable first.
There was a problem hiding this comment.
I will modify the code.
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
@goiri Please help to review the code again, thank you very much! |
|
🎊 +1 overall
This message was automatically generated. |
|
@goiri Thank you very much for your help reviewing the code, I will follow up with YARN-11227. |
|
@goiri Thank you very much for helping to review the code, can you help merge to trunk branch? I will follow up with YARN-11227. |
|
@goiri Thank you very much for helping to review the code! |
JIRA: YARN-11228. [Federation] Add getAppAttempts, getAppAttempt REST APIs for Router.